# -*- coding: utf-8 -*-

################################################################################
## Form generated from reading UI file 'window1.ui'
##
## Created by: Qt User Interface Compiler version 5.15.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################

from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *


class Ui_window1(object):
    def setupUi(self, window1):
        if not window1.objectName():
            window1.setObjectName(u"window1")
        window1.resize(800, 600)
        self.centralwidget = QWidget(window1)
        self.centralwidget.setObjectName(u"centralwidget")
        self.pushButton = QPushButton(self.centralwidget)
        self.pushButton.setObjectName(u"pushButton")
        self.pushButton.setGeometry(QRect(350, 220, 93, 28))
        window1.setCentralWidget(self.centralwidget)
        self.menubar = QMenuBar(window1)
        self.menubar.setObjectName(u"menubar")
        self.menubar.setGeometry(QRect(0, 0, 800, 26))
        window1.setMenuBar(self.menubar)
        self.statusbar = QStatusBar(window1)
        self.statusbar.setObjectName(u"statusbar")
        window1.setStatusBar(self.statusbar)

        self.retranslateUi(window1)
        self.pushButton.clicked.connect(self.open)  # 将打开按钮和相应的槽函数连接起来

        QMetaObject.connectSlotsByName(window1)
    # 定义槽函数（子窗口的打开）
    def open(self):
        from PyQt5从入门到实践 import window2
        self.second = window2.Ui_window2()
        self.second.show()
    # setupUi
    def retranslateUi(self, window1):
        window1.setWindowTitle(QCoreApplication.translate("window1", u"window1", None))
        self.pushButton.setText(QCoreApplication.translate("window1", u"\u6253\u5f00", None))
    # retranslateUi


import sys
from PySide2 import QtWidgets
if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    MainWindow = QtWidgets.QMainWindow()
    ui = Ui_window1()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec_())




